package com.fz.utils;


import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Properties;

public class PropertyUtil {
	private static Properties pro = null;
	public static String getProperties(String key){
		try {
			if(pro == null){
				pro = new Properties();

				InputStream alimsg = Thread.currentThread().getContextClassLoader().getResourceAsStream("alimsg.properties");
				InputStreamReader readerAlimsg = new InputStreamReader(alimsg,"UTF-8");
				pro.load(readerAlimsg);
				alimsg.close();
				readerAlimsg.close();


				InputStream alioss = Thread.currentThread().getContextClassLoader().getResourceAsStream("alioss.properties");
				InputStreamReader readerAlioss = new InputStreamReader(alioss,"UTF-8");
				pro.load(readerAlioss);
				alioss.close();
				readerAlioss.close();
			}
			if(key == null)
				return "";
			else
				return pro.getProperty(key);
		}catch (Exception e){

		}
		return "";
	}
}
